package com.jinzheng.model;

import com.jinzheng.constants.PetConstant;

/**
 * @author Administrator
 * @date 2020/12/30 9:13
 * @description
 **/
public class Penguin extends Pet {

    private Integer height;         //身高

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        if (height>= PetConstant.PENGUIN_HEIGHT){
            height = PetConstant.PENGUIN_HEIGHT;
        }
        this.height = height;
    }

    @Override
    public String toString() {
        return "Penguin{" +
                "，name=" + super.getName() +'\''+
                "，strain=" + super.getStrain() +'\''+
                "，living=" + super.getLiving() +'\''+
                "，height=" + height +
                '}';
    }
}
